<?php echo $this->fetch('member.header.html'); ?>
<script type="text/javascript">
function DropDdata(id)
{
	if(confirm('您确定要删除这些咨询吗') == true)
	{
		var url = REAL_SITE_URL+"/index.php?app=my_qa&act=drop";
		$.getJSON(url,{id:id},function(data){
			if(data == true){
				msg("操作成功");
				setTimeout(function(){
					window.location.href=REAL_SITE_URL+"/index.php?app=my_qa";
				},1500);
			} 
		},"json");
	}
}
</script>
<div id="page-my-qa" class="mb10">
	<article class="padding10 page-body">
    	<?php $_from = $this->_var['my_qa_data']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'my_qa_list');$this->_foreach['qa'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['qa']['total'] > 0):
    foreach ($_from AS $this->_var['my_qa_list']):
        $this->_foreach['qa']['iteration']++;
?>
		<ul>
        	<li><a href="<?php echo url('app=goods&=&id=' . $this->_var['my_qa_list']['item_id']. ''); ?>"><?php echo $this->_var['my_qa_list']['item_name']; ?><em>[<?php echo $this->_var['lang'][$this->_var['my_qa_list']['type']]; ?>]</em></a></li>
        	<li class="webkit-box mt10 clearfix">
            	<span>
                	<img width="50" height="50" src="<?php echo $this->_var['my_qa_list']['portrait']; ?>" />
                    <?php if ($this->_var['my_qa_list']['user_name'] != ''): ?><?php echo htmlspecialchars($this->_var['my_qa_list']['user_name']); ?><?php else: ?>游客<?php endif; ?>
                </span>
            	<div class="qa-box">
                	<dl>
                        <dd style="color:#E4393C;">咨询内容：<?php echo htmlspecialchars($this->_var['my_qa_list']['question_content']); ?></dd>
                        <dd class="time mt5"><?php echo local_date("Y-m-d H:i:s",$this->_var['my_qa_list']['time_post']); ?></dd>
                        <?php if ($this->_var['my_qa_list']['reply_content']): ?>
                        <dd class="mt5" style="color:#289039;">我的回复：<?php echo htmlspecialchars($this->_var['my_qa_list']['reply_content']); ?></dd>
                        <dd class="time mt5"><?php echo local_date("Y-m-d H:i:s",$this->_var['my_qa_list']['time_reply']); ?></dd>
                        <?php endif; ?>
                    </dl>
                </div>
            </li>
            <li class="btn-box mt10">
                 <a href="javascript:;" onclick="DropDdata('<?php echo $this->_var['my_qa_list']['ques_id']; ?>');" class="delete">删除</a>
                 <?php if ($this->_var['my_qa_list']['reply_content'] == ''): ?><a href="<?php echo url('app=my_qa&act=reply&ques_id=' . $this->_var['my_qa_list']['ques_id']. ''); ?>">回复</a>
                 <?php else: ?>
                 <a href="<?php echo url('app=my_qa&act=edit_reply&ques_id=' . $this->_var['my_qa_list']['ques_id']. ''); ?>"> 编辑回复</a>
                 <?php endif; ?>
            </li>
        </ul>
        <?php endforeach; else: ?>
        <div class="no-record">
             <span>没有符合条件的记录</span>
        </div>
        <?php endif; unset($_from); ?><?php $this->pop_vars();; ?> 
	</article>
    <?php if ($this->_var['my_qa_data']): ?>
    <?php echo $this->fetch('page.bottom.html'); ?>
    <?php endif; ?>
</div>
<?php echo $this->fetch('footer.html'); ?>